//
//  KYCodeButton.h
//  KYKJPackDemo
//
//  Created by Jordan zhou on 2017/9/28.
//  Copyright © 2017年 ???. All rights reserved.
//

#import <UIKit/UIKit.h>
@class KYCodeButton;
typedef NSString* (^DidChangeBlock)(KYCodeButton *codeButton,int second);
typedef NSString* (^DidFinishedBlock)(KYCodeButton *codeButton,int second);
typedef void (^TouchedDownBlock)(KYCodeButton *codeButton,NSInteger tag);
@interface KYCodeButton : UIButton
/**
 *  定时器
 */
@property (nonatomic, strong) NSTimer *timer;

/**
 *  秒数
 */
@property (nonatomic, assign) NSInteger second;

/**
 *  总秒数
 */
@property (nonatomic, assign) long totalSecond;

@property (nonatomic, copy) DidChangeBlock didChangeBlock;
@property (nonatomic, copy) DidFinishedBlock didFinishedBlock;
@property (nonatomic, copy) TouchedDownBlock touchedDownBlock;

- (void)addToucheHandler:(TouchedDownBlock)touchHandler;
- (void)didChange:(DidChangeBlock)didChangeBlock;
- (void)didFinished:(DidFinishedBlock)didFinishedBlock;
- (BOOL)startWithSecond:(int)second;
- (void)stop;

@end
